Skip to content

Remove mergenupkg: split Myriad and Myriad.Sdk into separate NuGet packages#189

Merged
7sharp9 merged 3 commits intomasterfrom
copilot/fix-mergenupkg-build-issue
Mar 1, 2026
Merged

Remove mergenupkg: split Myriad and Myriad.Sdk into separate NuGet packages#189
7sharp9 merged 3 commits intomasterfrom
copilot/fix-mergenupkg-build-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 19, 2026

  • Remove dotnet-mergenupkg from .config/dotnet-tools.json
  • Remove the dotnet mergenupkg step from build.proj
  • Update Myriad.Sdk.proj: remove SuppressDependenciesWhenPacking, remove Paket import, add PackageReference to Myriad
  • Update src/Myriad.Sdk/build/Myriad.Sdk.props: locate Myriad.dll via $(NuGetPackageRoot) using version extracted from $(MSBuildThisFileFullPath) with override condition
  • Update .github/workflows/publish.yml: windows-latestubuntu-latest
  • Update README.md: update example versions (0.5.0 → 0.8.4), add note that Myriad.Sdk pulls in Myriad automatically
  • Update CHANGELOG.md: document the split-package change and mergenupkg removal under 0.8.4
Original prompt

This section details on the original issue you should resolve

<issue_title>mergenupkg breaks build pipeline in .NET 9; ci still using .NET 6</issue_title>
<issue_description>## Problem overview

I noticed Myriad's main branch had been ~mostly upgraded to .NET 9 but the package wasn't available on NuGet. There are two issues:

  • The publish action is configured to install .NET 6 (and Windows — you probably don't want that). We should change this line to 9.x

  • We can't publish the package anyway, because the mergenupkg build step is broken in .NET 9:

Myriad cadence$ dotnet tool restore
Failed to validate package signing.

Verifying dotnet-mergenupkg.3.0.0

Signature type: Repository
  Subject Name: CN=NuGet.org Repository by Microsoft, O=NuGet.org Repository by Microsoft, L=Redmond, S=Washington, C=US
  SHA256 hash: 0E5F38F57DC1BCC806D8494F4F90FBCEDD988B46760709CBEEC6F4219AA6157D
  Valid from: 4/9/2018 9:00:00 PM to 4/14/2021 9:00:00 AM

warn : NU3018: The repository primary signature found a chain building issue: RevocationStatusUnknown: An incomplete certificate revocation check occurred.
error: NU3037: The repository primary signature validity period has expired.
error: NU3028: The repository primary signature's timestamp found a chain building issue: ExplicitDistrust: The trust setting for this policy was set to Deny.

Package signature validation failed.

Instructions for reproduction

  • Install .NET 9 SDK
  • Run dotnet tool restore from repository root.

Proposed solution

  • Publish myriad as a .NET tool and Myriad.Sdk as a separate package
  • OR develop some solution to allow MSBuild to locate build scripts inside our dotnet tool install directory.

I'm leaning toward the first for simplicity sake. I tried to figure out how to make the second solution work, but it seems like more trouble than its worth. Let me know which approach you prefer and I'll submit a PR.</issue_description>

Comments on the Issue (you are @copilot in this section)

@7sharp9 Having two packages makes using it more difficult to use though though right?

I think, (I forget now because so much time has passed) that @enricosada used mergenupkg due to a limitation in dotnet tools at that point in time. I just cant remember now. When we were both working at Jet the basis for the package architecture came from Falanx which has the same build steps and cache checking. I mean, you dont need to know all this, I'm just thinking out loud :-)</comment_new>
<comment_new>@7sharp9
I wonder if the issue was that the myriad.sdk could not have the tool as a dependency?</comment_new>
<comment_new>@7sharp9
To be honest I think I've forgot most of the issues over time. I wonder if the Myriad.Sdk could prompt to do an install if it detects the absence of the tool?</comment_new>
<comment_new>@7sharp9
Also, if there was some warning and I got round to updating a template that would even things out.</comment_new>
<comment_new>@7sharp9
Anecdotally it should be ok to split, its just getting round to looking at it an analysing to ensure theres a good experience and updating the docs. And fixing the docs, whew!</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…arate packages

- Remove dotnet-mergenupkg from .config/dotnet-tools.json (broken in .NET 9 due to expired signature certificates)
- Remove the dotnet mergenupkg step from build.proj
- Update Myriad.Sdk.proj: remove SuppressDependenciesWhenPacking, remove Paket.Restore.targets import (project has no Paket deps), add PackageReference to Myriad so it becomes a proper NuGet dependency
- Update src/Myriad.Sdk/build/Myriad.Sdk.props: replace embedded DLL path with dynamic path via $(NuGetPackageRoot) and version extracted from the package directory path using $(MSBuildThisFileFullPath)
- Update .github/workflows/publish.yml: change windows-latest to ubuntu-latest

Co-authored-by: 7sharp9 <588746+7sharp9@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix mergenupkg build step for .NET 9 Remove mergenupkg: split Myriad and Myriad.Sdk into separate NuGet packages Feb 19, 2026
Copilot AI requested a review from 7sharp9 February 19, 2026 17:33
Copy link
Copy Markdown
Collaborator

@7sharp9 7sharp9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are the risks with this PR?

@7sharp9
Copy link
Copy Markdown
Collaborator

7sharp9 commented Mar 1, 2026

@copilot what are the risks or change in behavior because of this fix, does anything need to be added to the docs or README.md?

- Update package versions in README examples from 0.5.0 to 0.8.4
- Add note that Myriad.Sdk automatically pulls in Myriad as a transitive dependency
- Add CHANGELOG entries for mergenupkg removal and split-package change

Co-authored-by: 7sharp9 <588746+7sharp9@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 1, 2026

what are the risks with this PR?

The main risks are:

  1. Path resolution (Myriad.Sdk.props): The path to Myriad.dll is now constructed at build time using $(NuGetPackageRoot) + the version extracted from $(MSBuildThisFileFullPath). This is standard NuGet behavior and works on all platforms. Local/test projects that import Myriad.Sdk.props directly are unaffected because they already override MyriadSdk_Generator_Exe explicitly, and the props file has a Condition="'$(MyriadSdk_Generator_Exe)' == ''" guard.

  2. Two-package restore: Myriad.Sdk now declares Myriad as a transitive NuGet dependency. NuGet (and Paket) will automatically restore both — no change needed in consumer project files.

  3. Version pinning: If a user has manually pinned <PackageReference Include="Myriad" /> at a different version than Myriad.Sdk, the path in Myriad.Sdk.props still uses the Myriad.Sdk version to locate the tool, which is the safe and correct behavior.

@copilot what are the risks or change in behavior because of this fix, does anything need to be added to the docs or README.md?

Behavior changes:

  • Myriad.Sdk now depends on Myriad (the CLI tool) as a NuGet transitive dependency — previously the tool DLL was embedded inside Myriad.Sdk via mergenupkg. NuGet and Paket both pick up the transitive dependency automatically, so existing consumer projects need no changes.
  • The dotnet-mergenupkg tool has been removed from .config/dotnet-tools.json, so dotnet tool restore now only restores paket.
  • CI now runs on ubuntu-latest instead of windows-latest.

Documentation updated in commit a8c15c6:

  • README: updated example package versions from 0.5.0 → 0.8.4, added a sentence noting that Myriad.Sdk pulls in Myriad automatically with no separate dotnet tool install step needed.
  • CHANGELOG: documented the split-package change and mergenupkg removal under [0.8.4].

Copilot AI requested a review from 7sharp9 March 1, 2026 17:38
@7sharp9 7sharp9 marked this pull request as ready for review March 1, 2026 17:51
Copilot AI review requested due to automatic review settings March 1, 2026 17:51
@7sharp9 7sharp9 merged commit ec2bbc9 into master Mar 1, 2026
@7sharp9 7sharp9 deleted the copilot/fix-mergenupkg-build-issue branch March 1, 2026 17:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the dotnet-mergenupkg-based packaging flow and instead publishes Myriad (CLI tool) and Myriad.Sdk (MSBuild integration) as separate NuGet packages, updating build/CI/docs to match.

Changes:

  • Removes dotnet-mergenupkg from local tools and deletes the merge step from build.proj.
  • Updates Myriad.Sdk to depend on Myriad and updates Myriad.Sdk.props to locate Myriad.dll via $(NuGetPackageRoot) using the SDK package version.
  • Updates publish workflow runner OS and refreshes README/CHANGELOG documentation for the new packaging model.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Myriad.Sdk/build/Myriad.Sdk.props Derives Myriad.Sdk version from install path and uses it to locate Myriad.dll in the myriad tool package under the global packages folder.
src/Myriad.Sdk/Myriad.Sdk.proj Removes packing suppression and adds PackageReference to Myriad so it becomes a transitive dependency.
build.proj Removes mergenupkg step; still packs Myriad.Sdk and the solution.
README.md Updates example versions and documents that Myriad.Sdk pulls in the Myriad CLI transitively.
CHANGELOG.md Notes removal of dotnet-mergenupkg, package split, and CI runner change under 0.8.4.
.github/workflows/publish.yml Switches CI runner from windows-latest to ubuntu-latest.
.config/dotnet-tools.json Removes dotnet-mergenupkg tool from the repo tool manifest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 23 to +25
<!-- pack sdk then whole sln -->
<Exec Command='dotnet pack src/Myriad.Sdk/Myriad.Sdk.proj -c Release -o "$(NupkgsDir)" /p:Version=$(Version)' />
<Exec Command='dotnet pack src/Myriad.sln -c Release -o "$(NupkgsDir)" /p:Version=$(Version)' />
<Exec Command='dotnet mergenupkg --source "$(NupkgsDir)/Myriad.Sdk.$(Version).nupkg" --other "$(NupkgsDir)/Myriad.$(Version).nupkg" --tools --only-files' />
<Exec Command='dotnet pack src/Myriad.sln -c Release -o "$(NupkgsDir)" /p:Version=$(Version)' />
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Myriad.Sdk.proj now has a PackageReference to Myriad, but the Pack target packs Myriad.Sdk before packing the solution that produces Myriad.$(Version).nupkg. For a new version/tag (or any local pack where that version isn't already on NuGet), dotnet pack src/Myriad.Sdk/Myriad.Sdk.proj will fail restore because Myriad at $(Version) isn't available yet. Consider either packing Myriad first and adding $(NupkgsDir) as a restore source when packing Myriad.Sdk, or switching to a project-reference-based approach so the dependency can be resolved without requiring a pre-published package.

Copilot uses AI. Check for mistakes.
<Description>MSBuild integration between Myriad and .NET Sdk projects</Description>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Myriad" Version="$(Version)" />
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a PackageReference to Myriad means dotnet pack of Myriad.Sdk.proj must be able to restore Myriad at $(Version) from configured NuGet sources. When cutting a new release (or packing locally before publishing), that version of Myriad typically doesn't exist yet, so the pack/restore will fail unless the build sets up a local source (e.g. $(NupkgsDir)) or uses a project-reference-based approach.

Suggested change
<PackageReference Include="Myriad" Version="$(Version)" />
<ProjectReference Include="..\Myriad\Myriad.fsproj" />

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mergenupkg breaks build pipeline in .NET 9; ci still using .NET 6

3 participants